<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            position: relative;
            width: 224px;
            height: 207px;
            background-color: #2c3e50;
        }
        .box ul{
            margin: 0;
            padding: 0;
            list-style: none;
            position: absolute;
            width: 50px;
            top:50%;
            left: 50%;
            transform: translate(-50%,-50%);
        }
        .box ul li{
            height: 5px;
            background-color: white;
            transition: all 0.3s ease-in-out;


        }
        .box ul li.da1{
            margin-bottom: 8px;

        }
        .box ul li.da2{
            margin-bottom: 8px;
        }
        .box ul.animate li.da1{
            transform: rotate(45deg) translate(13px ,5px);
           
        }
        .box ul.animate li.da2{
           
            background-color: transparent;
        }
        .box ul.animate li.da3{
           transform: rotate(-45deg) translate(13px,-5px);
           
           

        }
        
    </style>
</head>
<body>
    <div class="box">
        <ul id="menu">
            <li class="da1"></li>
            <li class="da2"></li>
            <li class="da3"></li>
        </ul>
    </div>
  
    <script>
        document.getElementById('menu').onclick=function(){
            this.classList.toggle('animate');
           
        }
    </script>

</body>
</html>